// components/good/good.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    goods: Object, // 商品信息
    isGroup: {
      type: Boolean,
      value: false
    } // 是否为组长
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    onGoodsDetail () {
      let goods = this.properties.goods;
      let url   = '/pages/goods/detail/detail?id=' + goods.goods_id;
      if(goods.hasOwnProperty('recommend')){
        url += '&recommend=' + JSON.stringify(goods['recommend']);
      }
      wx.navigateTo({
        url: url
      })
    }
  }
});
